home *** CD-ROM | disk | FTP | other *** search
- DCListview PLUGIN
- -----------------
-
- This plugin creates a GadTools Listview gadget, almost identical to the
- standard EasyGUI one, except that it will also report double-clicks on list
- items.
-
- Usage:
-
- [DCLIST, {actionfunction}, dc, TRUE]
-
- Notes:
- - Be sure the 'isgt' field of the PLUGIN gadget is always TRUE, since
- this uses a GadTools gadget.
- - The DCLIST constant (which =PLUGIN) is available to be used in your
- EasyGUI gadget list, as shown above. This can make plugins in gadget lists
- easier to identify, especially if you use a lot of different plugins.
- - Your action function will be called (or your action value returned by
- easyguiA()) when:
- - an item is selected with the mouse, and again on a double click.
- - the assigned key is pressed, alone or shifted.
- NOTE: if you use an action value instead of an action function, you
- won't hear about double clicks since your GUI will have closed :-)
-
- Methods:
-
- dclistview(tags)
-
- The constructor for this plugin, where 'tags' is a PTR TO a list of
- tagitems from those listed below marked [I]. All values default to
- something reasonable, so you can use simply [TAG_DONE] as your list.
- You *must* open 'utility.library' prior to calling this function, or
- it will raise a "util" exception.
- This function has no return value.
-
- set(attr, val)
-
- Sets any attribute to the value given, where 'attr' is any item
- listed below that is marked [S], and 'val' is some reasonable value
- for said attribute.
- This function has no return value, EXCEPT when setting DCLV_CURRENT
- to a new value. In this case it returns the value that DCLV_CURRENT
- was actually set to, should you have tried to set it to a value that
- was out of range.
-
- value, check:=get(attr)
-
- Gets the value for the specified attribute, where 'attr' is any item
- listed below marked [G]. The second returned value, 'check', is TRUE
- if 'attr' is in fact "getable", otherwise FALSE.
-
- END *must* be called for each NEWed object.
-
- Possible attribute tags:
-
- DCLV_LABEL [I..]
- The label which appears above the gadget. Including a "_" in
- this string will automatically assign the next character as the
- keyboard shortcut, and will indicate it as such in the label.
- (Default: No label text)
- DCLV_RELX [I..]
- The usual relative gadget width (Default: 5)
- DCLV_RELY [I..]
- The usual relative gadget height (Default: 5)
- DCLV_LIST [ISG]
- The list to be displayed in the gadget. Usual gadtools handling
- applies: set to NIL to remove the list from the gadget, set to -1
- to detach the list without clearing it. (Default: NIL)
- DCLV_CURRENT [ISG]
- The list item to be highlighted and placed at the top of the listview.
- This item will also be displayed beneath the listview under v37 or
- with a highlight bar under v39. This value will always be updated
- when the user selects a list item.
- ** NOTE: If you don't want ANY list item highlighted initally, set
- this tag to -1 (Default). NOTE FURTHER, though, that the value of
- this attribute will NOT change if the user does not manipulate the
- listview in any way. If you set DCLV_CURRENT to -1 at any point,
- be prepared to properly handle -1 as a returned value when you
- get(DCLV_CURRENT).
- DCLV_DISABLED [ISG]
- Whether this gadget is disabled. Works under v39+ only, and is
- minimal at best (the listview is disabled, but the attached prop
- gadget will still scroll the list). (Default: FALSE)
- DCLV_TOP [ISG]
- Sets which item in the list is to be diplayed at the top of the
- listview, without necessarily being currently selected.
- DCLV_CLICK [..G]
- This will be set to TRUE when an item from the listview has been
- double-clicked.
-
- Exceptions:
-
- "dclv" will be raised by gtrender() if the gadget can't be created.
- "util" will be raised by dclistview() if utility.library isn't open.
-
- History:
-
- 13-Jul-97 First release
-
- 19-Aug-97 Second release
- - removed a v39-only function that pretty much squashed the plugin
- under v37.
-
- 19-Jan-98 Third release
- - rewritten in a style similar to the EasyPLUGINs Style Guide;
- - replaced long list of constructor arguments with a taglist;
- - replaced specific set#?/get#? functions with multi-purpose ones,
- allowing many more attributes to be set/get with minimum effort,
- and allowing the entire dclistview object to be made private;
- - now checks if window and gadget exist (i.e., not iconified) before
- updating attributes;
- - simplified node-counter function;
-